"""异步服务器"""

import socket

sk = socket.socket()
sk.bind(('localhost', 8080))
sk.listen(500)

while True:
    connect, address = sk.accept()
    request = connect.recv(1024)

    response = """\
    HTTP/1.1 200 OK
    Hello, World!
    """
    connect.send(response.encode(encoding='utf-8'))
    connect.close()


